import {Component, Input, OnInit} from '@angular/core';
import {TagData} from '../../../../entity/tag-data.model';

@Component({
  selector: 'app-device',
  templateUrl: './device.component.html',
  styleUrls: ['./device.component.css']
})
export class DeviceComponent implements OnInit {
  @Input()
  turbineStatus: TagData;//逆变器状态
  @Input()
  deviceName: string;//逆变器名称
  @Input()
  GridMerPower: TagData;//有功功率
  @Input()
  GriReaPower: TagData;//无功功率
  @Input()
  powerDay: TagData;//发电量
  @Input()
  statusColor: string;//逆变器状态颜色

  @Input()
  farmId: number = 0;//当前风场id

  isRun: boolean = false;

  constructor() {
  }

  ngOnInit() {
  }

  initData() {
    if (this.turbineStatus.value == 1) {
      this.isRun = true;
    } else {
      this.isRun = false;
    }
  }

}


// WEBPACK FOOTER //
// ./src/app/module/monitor/inverter-list/device/device.component.ts
